package com.feicheng.common.mt;

import com.meituan.sdk.DefaultMeituanClient;
import com.meituan.sdk.auth.MeituanTokenData;
import com.meituan.sdk.MeituanClient;
import lombok.Data;
import org.springframework.cglib.core.Local;

import java.time.LocalDateTime;


public class Mtmd {
    private String mdid;

    private String accessToken;

    private String refreshToken;

    private LocalDateTime gqsj;

    public Mtmd(String mdid) {
        this.mdid = mdid;
    }

    public void setAccessTokenData(MeituanTokenData tokenData) {
        LocalDateTime now = LocalDateTime.now();
        this.gqsj = now.plusSeconds(tokenData.getExpireIn() - (3600L * 24));
        this.accessToken = tokenData.getAccessToken();
        this.refreshToken = tokenData.getRefreshToken();
    }

    public String getAccessToken() {
        return this.accessToken;
    }

    public String getRefreshToken() {
        return this.refreshToken;
    }

    public LocalDateTime getGqsj() {
        return this.gqsj;
    }


}
